package common

import (
	fileServices "blog/app/services/system/file"
	upload2 "blog/utils/upload"
	"io"
)

type upload struct {
}

var Upload = new(upload)

func (u upload) UploadHash(fileName string, size int64, render io.Reader) (string, error) {
	file := upload2.NewFile(fileName, size, render)
	create, _ := fileServices.File{}.Upload(file, false)
	return create.Hash, nil
}
